package com.hzw.saas.api.hpc.enums;

import java.util.Objects;

/**
 * @author zzl
 * @since 02/04/2021
 */
public enum HpcAccountRecordStatus {
    NORMAL(1, "正常"),
    UNBOUND(0, "解绑"),
    ;

    private final Integer value;
    private final String text;

    HpcAccountRecordStatus(Integer value, String text) {
        this.value = value;
        this.text = text;
    }

    public Integer value() {
        return value;
    }

    public String text() {
        return text;
    }

    public static String text(Integer value) {
        for (HpcAccountRecordStatus hpcAccountStatus : HpcAccountRecordStatus.values()) {
            if (Objects.equals(hpcAccountStatus.value, value)) {
                return hpcAccountStatus.text;
            }
        }
        return null;
    }

    public static HpcAccountRecordStatus instance(Integer value) {
        for (HpcAccountRecordStatus hpcAccountStatus : HpcAccountRecordStatus.values()) {
            if (Objects.equals(hpcAccountStatus.value, value)) {
                return hpcAccountStatus;
            }
        }
        return null;
    }
}
